package cn.onein.edu.biz.bean;

import java.io.Serializable;
import java.util.Date;

import cn.onein.edu.common.SexType;

public class User implements Serializable {

	private static final long serialVersionUID = 688322228537979845L;

	private Long id;

	private Long levelId;

	private Date levelExpires;

	private String name;

	private Long qq;

	private String email;

	private String nickName;

	private String mobile;

	private String password;

	private Boolean locked;

	private Boolean active;

	private Date createDate;

	private Date lastLogin;

	private String lastIp;

	private Date birthday;

	private SexType sex;

	private SexType parentSex;

	private String disposition;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getLevelId() {
		return levelId;
	}

	public void setLevelId(Long levelId) {
		this.levelId = levelId;
	}

	public Date getLevelExpires() {
		return levelExpires;
	}

	public void setLevelExpires(Date levelExpires) {
		this.levelExpires = levelExpires;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getQq() {
		return qq;
	}

	public void setQq(Long qq) {
		this.qq = qq;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public String getLastIp() {
		return lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public SexType getParentSex() {
		return parentSex;
	}

	public void setParentSex(SexType parentSex) {
		this.parentSex = parentSex;
	}

	public String getDisposition() {
		return disposition;
	}

	public void setDisposition(String disposition) {
		this.disposition = disposition;
	}

	public SexType getSex() {
		return sex;
	}

	public void setSex(SexType sex) {
		this.sex = sex;
	}

	public void setSexValue(Boolean sexValue) {
		if(null == sexValue){
			sex = null;
			return;
		}
		if(true == sexValue){
			sex = SexType.M;
		}
		if(false == sexValue){
			sex = SexType.F;
		}
	}

	public Boolean getSexValue() {
		if(null == sex){
			return null;
		}
		return sex.toString().equals("F") ? false : true;
	}
	
	public void setParentSexValue(Boolean parentSexValue) {
		if(null == parentSexValue){
			parentSex = null;
			return;
		}
		if(true == parentSexValue){
			parentSex = SexType.M;
		}
		if(false == parentSexValue){
			parentSex = SexType.F;
		}
	}

	public Boolean getParentSexValue() {
		if(null == parentSex){
			return null;
		}
		return parentSex.toString().equals("F") ? false : true;
	}
}
